package cn.antsing.consumer.controller;

import cn.antsing.api.ICalculate;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumerController {
    @Reference(version = "${demo.service.version}",
            application = "${dubbo.application.id}",
           registry = "${ddubbo.registry.id}")
    private ICalculate calculate;

    @RequestMapping("/{a}/{b}")
    public int div(@PathVariable Integer a, @PathVariable Integer b){
        return calculate.div(a,b);
    }
}
